<?php
/**
 * 火车头采集发布接口 发布数据
 */
defined('IN_PHPCMS') or exit('No permission resources.');
define('HASH', SHA1('abc'));

if(HASH != $_GET['hash']) exit('验证错误');
if(!$_GET['siteid']) exit("站点ID不存在");

$categorys = getcache('category_content_'.$_GET['siteid'],'commons');

if($_POST){
    $info = $_POST;
    $db = pc_base::load_model('content_model');
    $category = $categorys[$info['catid']];
    $modelid = $category['modelid'];
    $db->set_model($modelid);
    //如果该栏目设置了工作流，那么必须走工作流设定
    $setting = string2array($category['setting']);
    $workflowid = $setting['workflowid'];
    if($db->add_content($info)) exit('成功');
    exit('失败');
}else{
    exit('未知操作');
}
?>